// ActionScript file
package com.tongji.housediy.view.titlewindows
{

	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.ui.Mouse;
	
	import mx.states.State;
	
	import org.osmf.media.MediaElement;
	import org.robotlegs.mvcs.Mediator;
	
	public class MaterialWindowMediator extends Mediator
	{
		[Inject]
		public var view:MaterialWindow;
		
		[Inject]
		private var currentstate:String="latexPaint";
		
		override public function onRegister():void
		{
			view.latexPaint.addEventListener(MouseEvent.CLICK, latexPaintClickHandler);
			view.wallPaper.addEventListener(MouseEvent.CLICK, wallPaperClickHandler);
			view.wallBrick.addEventListener(MouseEvent.CLICK, wallBrickClickHandler);
		}
		
		public function latexPaintClickHandler(event:MouseEvent):void
		{
			view.currentState="latexPaint";
		}
		
		public function wallPaperClickHandler(event:MouseEvent):void
		{
			view.currentState="wallPaper";
		}
		
		public function wallBrickClickHandler(event:MouseEvent):void
		{
			view.currentState="wallBrick";
		}
	}
}